<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <?php 
      for($n = 1;$n<=8;$n++){
          echo "<br>$n ";
          for($v = 2;$v<=7;$v++){
              echo "$v ";
          }
          echo "8;";
      }
      echo "<hr>";
      echo "<table border='1' width='400' height='200'>";
      $a = 0;
      for($n=1;$n<=4;$n++){
          echo "<tr>";
          for($v =1;$v<=6;$v++){
              $a++;
              echo "<td>$a</td>";
          }
          echo "</tr>";
      }
      echo "</table>";
    ?>

</body>
</html>